﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media.Effects;
using WWLauncher.Constant;
using WWLauncher.Model;
using WWLauncher.ViewModel;
using WWLauncher.ViewModel.Temp;

namespace WWLauncher.Util
{
    [Serializable]
    public class ThemeConfig : INotifyPropertyChanged
    {
        private string textColor; //字体颜色
        private BGStyle bgStyle; //背景风格
        private GradientBGParam gradientBgParam; //渐变背景参数
        private double blurValue;
        private int selectedIndex;

        public ThemeConfig()
        {
            var list = new GradientBGParamListModel();
            gradientBgParam = list.GradientBGParams.First();
            SelectedIndex = 0;
            bgStyle = BGStyle.GradientBac;
            textColor = "#000000";

        }

        public int SelectedIndex
        {
            get
            {
                return selectedIndex;
            }
            set
            {
                selectedIndex = value;
                OnPropertyChanged("SelectedIndex");
            }
        }

        public GradientBGParam GradientBgParam
        {
            get
            {
                return gradientBgParam;
            }
            set
            {
                gradientBgParam = value;
                OnPropertyChanged("GradientBGParam");
            }
        }
        public BGStyle BgStyle
        {
            get
            {
                return bgStyle;
            }
            set
            {
                bgStyle = value;
                OnPropertyChanged("BGStyle");
            }
        }
        /// <summary>
        /// 字体颜色
        /// </summary>
        public string TextColor
        {
            get
            {
                return textColor;
            }
            set
            {
                textColor = value;
                OnPropertyChanged("TextColor");
            }
        }
        public double BlurValue
        {
            get
            {
                return blurValue;
            }
            set
            {
                blurValue = value;
                OnPropertyChanged("BlurValue");
            }
        }

        [field: NonSerialized()]
        public event PropertyChangedEventHandler PropertyChanged;
        private void OnPropertyChanged(string propertyName)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}
